/**
 * related to listGridTemplate.ui
 * 
 * @Author : chenglm
 * @Timestamp : 2016-07-26
 */
var homemakingUtil = require("url/homemaking");
var root=ui("$");
var aLayout_img = ui("aLayout_img");
var img = ui("img");
var label_typeName = ui("label_typeName");
var aLayout_type = ui("aLayout_type");

var helperOpen = require("helper/open");

//设置数据绑定的映射关系
root.setMapping({
	"aLayout_type.tag":"id",
	"img.tag":"img",
	"label_typeName.text":"name",
	"aLayout_img.tag":"fileDomain",
	"label_typeName.tag":"parentId"
});

root.on("dataRefreshed", function(){
	if(img.tag){
		img.source= aLayout_img.tag+""+img.tag;
	}
});

aLayout_type.on("touch", function(data){
	if (label_typeName.tag == homemakingUtil.typeId.JiaDianWeiXiu) {
		helperOpen.open("source://view/homemaking/detail/toOrder3.ui",{id:aLayout_type.tag});
	} else {
		helperOpen.open("source://view/homemaking/detail/detail.ui",{id:aLayout_type.tag},"","pay_product_back");
	}
});
